import request from "@/utils/request";
import type {
  trademarkItemModel,
  trandemarkPageListModel,
} from "./model/trademarkModel";

// 枚举请求路径
const ApiPath = {
  // GET /admin/product/baseTrademark/{page}/{limit}
  GetDate: "/admin/product/baseTrademark",
  //POST /admin/product/baseTrademark/save
  AddDate: "/admin/product/baseTrademark/save",
  //PUT /admin/product/baseTrademark/update
  updateDate: "/admin/product/baseTrademark/update",
  //DELETE /admin/product/baseTrademark/remove/{id}
  removeDate: "/admin/product/baseTrademark/remove",
  getAllTrademarkList: "/admin/product/baseTrademark/getTrademarkList",
};

//获取品牌数据
export const getTrademarkListApi = (page: number, limit: number) => {
  return request.get<any, trandemarkPageListModel>(
    ApiPath.GetDate + `/${page}/${limit}`
  );
};
//获取所有品牌列表
export const getAllTrademarkListApi = () => {
  return request.get<any, trandemarkListModel>(ApiPath.getAllTrademarkList);
};
//新增品牌数据
export const AddTrademarkListApi = (TrademarkList: trademarkItemModel) => {
  return request.post(ApiPath.AddDate, TrademarkList);
};
//修改品牌数据
export const updateTrademarkListApi = (TrademarkList: trademarkItemModel) => {
  return request.put(ApiPath.updateDate, TrademarkList);
};
//删除品牌数据
export const removeTrademarkListApi = (id: number) => {
  return request.delete(ApiPath.removeDate + `/${id}`);
};
